/**
 * @author Linrui
 * @since 2011-03-15
 * 类别的业务层封装类 
 */
package com.qeado.sort.service.implement;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qeado.sort.dao.SortDao;
import com.qeado.sort.model.Sort;
import com.qeado.sort.service.SortService;
import com.qeado.util.PageHelper;

@Service
public class SortServiceImplement implements SortService {
	
	@Autowired
	private SortDao sortDao ;
	
	public List<Sort> listTopCategory() {
		return sortDao.listTopCategory();
	}

	public List<Sort> listByPcode(String Pcode) {
		return sortDao.listByPcode(Pcode);
	}

	public List<Sort> listByPid(String pid) {
		return sortDao.listByPid(pid);
	}
	
	public PageHelper listByPcodeByPage(int pageNum, String Pcode) {
		return sortDao.listByPcodeByPage(pageNum, Pcode);
	}

	public PageHelper listByPage(int pageNum) {
		return sortDao.listByPage(pageNum);
	}

	public PageHelper listByPidByPage(int pageNum, String Pid) {
		return sortDao.listByPidByPage(pageNum, Pid);
	}

	public List<Sort> listByTreeByCode(String typeCode) {
		return sortDao.listByTreeByCode(typeCode);
	}

	public List<Sort> listByTreeByPid(String Pid) {
		return sortDao.listByTreeByPid(Pid);
	}

	public Sort queryByCode(String typeCode) {
		return sortDao.queryByCode(typeCode);
	}

	public Sort queryById(String id) {
		return sortDao.queryById(id);
	}

	public PageHelper queryByName(int pageNum, String typeName) {
		return sortDao.queryByName(pageNum, typeName);
	}

	public boolean isChildNode(String sortID) {
		return sortDao.isChildNode(sortID);
	}

	public List<Sort> listLeafSortByPid(String sortID) {
		return sortDao.listLeafSortByPid(sortID);
	}

	public List<Sort> listLeafSortByPcode(String typeCode) {
		return sortDao.listByTreeByCode(typeCode);
	}

	public String getNameByCode(String typeCode) {
		return sortDao.getNameByCode(typeCode);
	}

	public List<Sort> listAllProdSort() {
		return sortDao.listAllProdSort();
	}
	
}
